#!/bin/bash

set  -e

cpu_num=`grep -c "model name" /proc/cpuinfo`
echo "cpu 总核数："$cpu_num

val=`expr $cpu_num - 1`
echo "cpu核数减1: $val"



mem_total=`free -h | grep Mem | awk '{print $2}'`
echo "物理内存总量："$mem_total

mem_total=`free  | grep Mem | awk '{print $2}'`



echo "scale=3;$mem_total/2/1024/1024" | b
#val=`expr $mem_total / 2 / 1024 / 1024 `
echo "内存总数除2: $val Gi "

